<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>新增公告</title>
	<#include "./comm/meta-base.ftl" />
	<#include "./comm/meta-easyui.ftl" />
	<script src="${Application.STATIC_SERVER}/plugs/beyondadmin/assets/js/editors/summernote/summernote.js"></script>
	<#include "./comm/meta-comm.ftl" />
	
</head>
<body>
		
<form id="data_form" role="form" class="page-form"   method="post" >
	<div class="buts-row-top row ">
			<a href="javascript:submitForm();"  class="btn btn-success">
				<i class="fa fa-check"></i>提 交</a>
			<a href="javascript:MainTab.closeTabAndRefresh('公告管理')" class="btn btn-default">
				<i class="fa fa-times"></i>取 消</a>
	</div>
	<div class="but-row-top-shadow"></div>
	
 	<!--表单块-->
	<div class="form-title">新增公告</div>
	<div class="row">
		<div class="form-group col-sm-12 ">
			<label class="col-sm-1 fm-label">公告标题</label>
			<div class="col-sm-6 fm-control">
				<input type="text" name="title" id="title" class="form-control easyui-validatebox" 
					data-options="required:true,validType:['length[1,128]']" />
			</div>
			<label class="col-sm-1 fm-label">状态</label>
			<div class="col-sm-3 fm-control">
				<select  name="status" class=" easyui-validatebox easyui-combobox" >
					<#list statusList as status>
						  <option value="${status.lookupCode}">${status.codeName}</option>
					</#list>
				</select>
			</div>
			
		</div>
	</div>
	
	<div class="row">
		<div class="form-group col-sm-12 ">
			<label class="col-sm-1 fm-label">公告副标题</label>
			<div class="col-sm-10 fm-control">
				<input type="text" name="subhead" id="subhead" class="form-control easyui-validatebox" 
					data-options="validType:['length[1,255]']" />
			</div>
		</div>
	</div>

	
	<div class="form-title" >公告内容</div>
	<div class="row" style="padding:0px 20px 0px 20px" >
		 <div id="summernote"  ></div>
		 <input type="hidden" id="context" name="context"></input>
		
	</div>
    
    
 </form>
</body>
</html>
<script type="text/javascript">
 $('#summernote').summernote({ height: 450,width:1280 });


//提交表单
function submitForm(){
	 var contextHtml = $('#summernote').code();
	 $("#context").attr("value",contextHtml);

	$("#data_form").form('submit', {
		url : '${basePath}/message/message-save',
		onSubmit: function (){
			showPageShade();//当提交时候，显示遮罩层
			if(!$(this).form('validate')){//页面验证
				hiddenPageShade();//未成功，隐藏遮罩层
				return false;
			}
			return true;
        },
		success : function(result) {
			hiddenPageShade();//成功后，隐藏遮罩层
			MainTab.closeTabAndRefresh("公告管理");
		}
	});
}




</script>


